package com.apply.repository;

import com.apply.entity.ApplyInfo;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * @author tianp
 */
public interface ApplyRepository extends JpaRepository<ApplyInfo, Long>, JpaSpecificationExecutor<ApplyInfo> {
    /**
     * 根据用户id查询报名信息
     *
     * @param id
     * @return
     */
    public List<ApplyInfo> findBySysUserId(Long id);

    public List<ApplyInfo> findByExamInfoIdAndSysUserId(Long examInfoId, Long sysUserId);

    public int countByExamInfoIdAndSysUserId(Long examInfoId, Long sysUserId);
}
